#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define endl "\n"
#define y1 Y1
#define pb(x) push_back(x)
#define PII pair<int, int>
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 1e5 + 10;
char a[10][10];
map<int, PII>mp;
int x1, y1, x2, y2, x3, y3, x4, y4, ret;
double xx, yy;

double dis(double X1, double Y1, double X2, double Y2) {
	return (X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2);
}

double check() {
	double f1 = dis(x1 * 1.0, y1 * 1.0, xx, yy);
	double f2 = dis(x2 * 1.0, y2 * 1.0, xx, yy);
	double f3 = dis(x3 * 1.0, y3 * 1.0, xx, yy);
	double f4 = dis(x4 * 1.0, y4 * 1.0, xx, yy);
	return fabs(f1 - f2) < 1e-8 && fabs(f2 - f3) < 1e-8 && fabs(f3 - f4) < 1e-8 && fabs(f1 - f3) < 1e-8 && fabs(f1 - f4) < 1e-8 && fabs(f2 - f4) < 1e-8;
}

bool zj() {
	return (x2 - x1) * (x3 - x1) + (y2 - y1) * (y3 - y1) == 0;
}

int Dis(int x, int y, int m, int n) {
	return (x - m) * (x - m)
}
signed main() {
	IOS;
	int cnt = 0;
	_for(i, 1, 9) {
		string s;
		cin >> s;
		_for(j, 1, 9) {
			a[i][j] = s[j - 1];
			if(a[i][j] == '#') {
				mp[++cnt] = {i, j};
			}
		}
	} 
//	_for(i, 1, cnt) {
//		cout << mp[i].fi << ' ' << mp[i].se << endl;
//	}
	_for(i, 1, cnt) {
		 x1 = mp[i].fi, y1 = mp[i].se;
		_for(j, i + 1, cnt) {
			 x2 = mp[j].fi, y2 = mp[j].se;
			_for(k, j + 1, cnt) {
				 x3 = mp[k].fi, y3 = mp[k].se;
				_for(t, k + 1, cnt) {
				 x4 = mp[t].fi, y4 = mp[t].se;
				  xx = (x1 + x2 + x3 + x4) / 4.0;
				  yy = (y1 + y2 + y3 + y4) / 4.0;
				 if(check() && zj()) {
				 	cout << " x1 = " << x1 << " y1 = " << y1
				 	     << " x2 = " << x2 << " y2 = " << y2
				 	     << " x3 = " << x3 << " y3 = " << y3
				 	     << " x4 = " << x4 << " y4 = " << y4 << endl;
				 	     cout << " xx = " << xx << " yy = " << yy << endl;
				 }
				}
			}
		}
	}
	cout << ret << endl;
	return 0;
}
/*
.#.......
#.#......
.#.......
.........
....#.#.#
.........
....#.#.#
........#
.........

*/
